import request from '@/utils/request'
// 获取批注
export function getPostil(id) {
  return request({
    url: `/api/SubDev/ZyOaProjectgantt/${id}/Actions/Postil`,
    method: 'get'
  })
}
// 发送批注
export function SendPostil(id, data) {
  return request({
    url: `/api/SubDev/ZyOaProjectgantt/${id}/Postil`,
    method: 'post',
    data
  })
}
// 删除批注
export function ZyOaProfitDeletePostil(id, index) {
  return request({
    url: `/api/SubDev/ZyOaProjectgantt/${id}/Postil/${index}`,
    method: 'DELETE'
  })
}

// 获取项目任务列表
export function TaskList(data, projectId) {
  return request({
    url: `/api/SubDev/ZyOaProjectgantt/${projectId}/Task`,
    method: 'get',
    data
  })
}
// 获取项目任务树形（新建任务）
export function TaskTreeView(projectId) {
  return request({
    url: `/api/SubDev/ZyOaProjectgantt/${projectId}/Task/Selector`,
    method: 'get'
  })
}
// 获取项目任务信息
export function TaskInfo(taskId) {
  return request({
    url: `/api/SubDev/ZyOaProjectgantt/Task/${taskId}`,
    method: 'get'
  })
}
// 添加项目任务
export function TaskCreate(data) {
  return request({
    url: `/api/SubDev/ZyOaProjectgantt/Task`,
    method: 'post',
    data
  })
}
// 修改项目任务
export function TaskUpdate(data) {
  return request({
    url: `/api/SubDev/ZyOaProjectgantt/Task/${data.id}`,
    method: 'PUT',
    data
  })
}